﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<meta http-equiv="X-UA-Compatible" content="IE=9">
<html>

<head>
	<title>http请求工具</title>
	<meta charset="utf-8">
	<meta http-equiv="Access-Control-Allow-Origin" content="*">
	<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
	<meta http-equiv="Cache-Control" content="no-store" />
	<meta http-equiv="Pragma" content="no-cache" />
	<meta http-equiv="Expires" content="0" />
	<link rel="shortcut icon" href="./img/favicon.ico" type="image/x-icon" />



	<!-- date -->
	<script type="text/javascript" src="./js/date/WdatePicker.js"></script>

	<!-- jquery and jquery'easyui -->
	<script type="text/javascript" src="./js/jquery/jquery.js"></script>
	<script type="text/javascript" src="./js/talent/core.js"></script>
	<script type="text/javascript" src="./js/talent/util.js"></script>
	<script type="text/javascript" src="./js/talent/ui.js"></script>

	<link rel="stylesheet" type="text/css" href="./css/talent/grid/grid.css" />
	<link rel="stylesheet" type="text/css" href="./css/talent/grid/grid-green.css" />
	<link rel="stylesheet" type="text/css" href="./css/talent/grid/grid-red.css" />

	<!-- jquery and jquery'easyui -->
	<link href="./js/ztree/css/zTreeStyle.css" rel="stylesheet" />
	<script src="./js/ztree/jquery.ztree.core-3.5.min.js"></script>
	<script src="./js/ztree/jquery.ztree.excheck-3.5.min.js"></script>
	<script src="./js/ztree/jquery.ztree.exedit-3.5.min.js"></script>
	<link rel="stylesheet" type="text/css" href="./js/jquery/easyui/themes/default/easyui.css" />
	<link rel="stylesheet" type="text/css" href="./js/jquery/easyui/themes/icon.css" />
	<script type="text/javascript" src="./js/jquery/easyui/jquery.easyui.min.js"></script>

	<link href="./js/bootstrap/css/bootstrap.min.css" rel="stylesheet">
	<script type="application/javascript" src="./js/bootstrap/js/bootstrap.min.js"></script>
	<!-- <link rel="stylesheet" type="text/css" href="./js/artDialog/skins/default.css" />
	<script type="text/javascript" src="./js/artDialog/source/artDialog.js"></script>
	<script type="text/javascript" src="./js/artDialog/source/jquery.artDialog.js"></script>
	<script type="text/javascript" src="./js/artDialog/source/artDialog.plugins.js"></script>
	<script type="text/javascript" src="./js/jstemplate/mustache.js"></script> -->


	<script type="text/javascript" src="./js/highlight/Scripts/shCore.js"></script>
	<script type="text/javascript" src="./js/highlight/Scripts/shBrushJScript.js"></script>

	<link href="./js/highlight/Styles/shCore.css" rel="stylesheet" type="text/css" />
	<link href="./js/highlight/Styles/shThemeDefault.css" rel="stylesheet" type="text/css" />

	<script src='./js/layer/layer.js' type="text/javascript"></script>

	<script type="text/javascript">

		SyntaxHighlighter.config.bloggerMode = true;

		SyntaxHighlighter.defaults['toolbar'] = false;
		SyntaxHighlighter.defaults.gutter = true;  //是否显示左侧的行数等信息


		SyntaxHighlighter.config.strings.viewSource = "查看";
		SyntaxHighlighter.config.strings.help = "?";


		SyntaxHighlighter.all();
	</script>


	<!-- talent validate -->
	<link href='./js/validate/css/validate.css' type='text/css' rel='stylesheet' />
	<script src='./js/validate/talent-validate-all.js' type="text/javascript"></script>

	<link href="./js/autocomplete/autocomplete.css" rel="stylesheet" />
	<script src="./js/autocomplete/autocomplete.js"></script>

	<link rel="stylesheet" type="text/css" href="./css/baseweb.css" />
	<script type="text/javascript" src="./js/baseweb.js"></script>


	<style type="text/css">
		.tt_main {
			background-color: #ffffff;
		}

		a {
			color: #000000;
			text-decoration: none;
		}

		.tt_panelHead {
			background-image: url(./css/skin/blue/list_table_Head.jpg);
			border: 1px solid #ffffff;
			border-bottom: 1px solid #ffffff;
			color: #000000;
			height: 37px;
			font-weight: bold;
			padding: 2px 2px 2px 5px;
			margin: 0px;
			font-size: 9pt !important;
			/*background-color: #344058;*/
		}


		.tt_queryTable {
			width: 100%;
			margin-bottom: 5px;
			border: 1px solid #ffffff;
			border-top: none;
			font-size: 9pt;
			background-color: #ffffff;
		}

		.tt_queryTable tr td {
			border: 1px solid #ffffff;
			border-top: 0px solid #ffffff;
		}

		.talent_grid_table {
			border: 1px solid #ffffff;
			background-color: #ffffff;
		}

		.talent_grid_table thead tr td {
			background-image: url(./css/skin/green/list_table_Head.jpg);
			/**background-color: #ffffff;*/
			border: 1px solid #ffffff;
			text-align: center;
			font-weight: bold;
			padding: 3px;
			height: 22px;
			color: #000000;
		}

		.talent_grid_table tbody tr td {
			border: 4px solid #bed2ee;
			padding: 3px;
			color: #000000;
		}



		.tt_queryTable_label {
			width: 12%;
			text-align: right;
			font-size: 12px;
			color: #000000;
			font-weight: bold;
			padding-right: 5px;
			background-color: #ffffff;
			;
		}

		.tt_queryTable_input {
			width: 90%;
			padding: 8px 15px;
			background-color: #ffffff;
		}
	</style>
</head>
<body>
	<div id="my_page_container" class='tt_page_container'>
		<form id='urlForm' action='${ctx}/common/httpclient/getHtml.talent' method='POST'>

			<div class='tt_panelHead' id='tt_panelHead'>

			</div>
			<table class='tt_queryTable' id='tt_queryTable'>
				<tr>
					<td class='tt_queryTable_label'>
						<span style='font-size:10pt'>模板地址</span>
					</td>
					<td class='tt_queryTable_input' colspan='4'>
						<input input type="text" name='templateName' id='templateName' style='width: 900px;'>
						<input name='isAbspath' value='true' type='hidden'>
					</td>
				</tr>
				<tr>
					<td class='tt_queryTable_input' colspan='4'>
						方法：
						<select id='tt_method' name='tt_method' style='width:60px;'>
							<option value='post'>post</option>
							<option value='get'>get</option>
							<option value='patch'>patch</option>
							<option value='delete'>delete</option>
						</select>
						URL：
						<input id='tt_request_url' name='tt_request_url' value='' style='width: 450px' />

						<input type='button' class="btn btn-primary" onclick="getHtml('urlForm');" value='请 求' /> |
						<input type='button' class="btn btn-primary" onclick="saveTemplate('urlForm');" value='保存模板' /> |
						<input type='button' class="btn btn-primary" onclick="deleteTemplate();" value='删除模板' /> |
						<input type='button' class="btn btn-primary" onclick="renameTemplate();" value='重命名' /> |
						<input type='button' class="btn btn-primary" onclick="getCookie('urlForm');" value='获取Cookie' />


						<span style="display:none">
							代理：
							<input id='' style='width: 50px' value='http' name='proxySchemeName' /> //
							<input id='' style='width: 140px' name='proxyHostName' /> :
							<input id='' style='width: 50px' name='proxyPort' value='8080' />
						</span>
					</td>
				</tr>

				<tr>
					<td class='tt_queryTable_label'>
						<span style='font-size:10pt'>请求头</span>
						<a  class="btn btn-primary"  href="javascript: addField('headerTable', 'headerTableBody', 'header', '', '', '', 1);">添加</a>
						<a   class="btn btn-primary"  href="javascript: removeField('headerTable', 'headerTableBody', 'header');">删除</a>
					</td>
					<td colspan='3' class='tt_queryTable_input' style='background-color: #ffffff; padding: 6px 4px;'>
						<span style='display: inline-block'>
							<table style='' class='talent_grid_table' id='headerTable'>
								<tbody id='headerTableBody'>
								</tbody>
							</table>
						</span>
					</td>
				</tr>
				<tr>
					<td class='tt_queryTable_label'>
						<span style='font-size:10pt'>请求参数</span>
						<a href="javascript:addField('fieldTable', 'fieldTableBody', 'param');" class="btn btn-primary">添加</a>
						<a href="javascript:removeField('fieldTable', 'fieldTableBody', 'param');"  class="btn btn-primary" >删除</a>
					</td>
					<td colspan='3' class='tt_queryTable_input' style='background-color: #ffffff; padding: 6px 4px;'>
						<span style='display: inline-block'>
							<table style='' class='talent_grid_table' id='fieldTable'>
								<tbody id='fieldTableBody'>
								</tbody>
							</table>
						</span>
					</td>
				</tr>


				<tr>
					<td class='tt_queryTable_label'>
						<span style='font-size:10pt'>请求体</span>
					</td>
					<td class='tt_queryTable_input' colspan='3'>
						<textarea style='width: 1000px' name='tt_requestbody' id='tt_requestbody'></textarea>
						<span style='color: red'>如果content-type不是text/plain，请清空此输入框</span>
					</td>
				</tr>

				<tr>
					<td class='tt_queryTable_label'>
						<span style='font-size:10pt'>响应字段</span>
						<a href="javascript:addField('respremarkTable', 'respremarkTableBody', 'respremark');"  class="btn btn-primary" >添加</a>
						<a href="javascript:removeField('respremarkTable', 'respremarkTableBody', 'respremark');"  class="btn btn-primary" >删除</a>
					</td>
					<td colspan='3' class='tt_queryTable_input' style='background-color: #ffffff; padding: 6px 4px;'>
						<span style='display: inline-block'>
							<table style='' class='talent_grid_table' id='respremarkTable'>
								<!--
								<thead>
									<tr>
										<td width='100px'>请求参数name</td>
										<td width='300px'>请求参数value</td>
										<td width='750px'>备注</td>
										<td>操作</td>
									</tr>
								</thead>
								-->
								<tbody id='respremarkTableBody'>

								</tbody>
							</table>
						</span>
					</td>
				</tr>

				<tr>
					<td class='tt_queryTable_label'>
						<span style='font-size:10pt'>备注</span>
					</td>
					<td class='tt_queryTable_input' colspan='3'>
						<textarea style='width: 1000px' name='tt_remark' id='tt_remark'></textarea>
					</td>
				</tr>

				<tr>
					<td class='tt_queryTable_label'>
						<label for="id">cookies</label>
					</td>
					<td class='tt_queryTable_input' colspan='3'>
						<input type='text' id='cookies1' style='width: 350px' name='cookies' />
						<input type='text' id='cookies2' style='width: 350px' name='cookies' />
						<input type='text' id='cookies3' style='width: 350px' name='cookies' />
						<input type='text' id='cookies4' style='width: 350px' name='cookies' />
						<input type='text' id='cookies5' style='width: 350px' name='cookies' />
					</td>
				</tr>
			</table>
		</form>

		<div id="autocompleteContainer" class="autocompleteContainer"
			style="width: 100px; display: none; position: absolute; z-index: 99999999;">

		</div>
		<div id="autocompleteContainer1" class="autocompleteContainer"
			style="width: 100px; display: none; position: absolute; z-index: 99999999;">

		</div>
	</div>


	<div id="response_div" class='tt_page_container' style='display: none'>
		<form>
			<div class='tt_panelHead' id='tt_panelHead' style='border-bottom:none'>
				<span style="font-weight: bolder;font-size: 23px">响应数据:</span>
				<span  onclick="clearResp();" class="btn btn-primary pull-right" >清空响应数据</span>
			</div>

			<table class='talent_grid_table'>
				<!-- 
				<thead>
					<tr>
						<td style='width: 500px;'>原始数据</td>
						<td style='width: 500px;'>格式化的数据</td>
					</tr>
				</thead>
				 -->
				<tbody>
					<tr>
						<td valign="top" style='width: 500px;text-align: left;background-color: #fff;'>
							<div id='html_container_json'>
							</div>
						</td>
						<td valign="top" style='width: 500px;text-align: left;background-color: #fff;'>
							<div id='html_container' style='word-break:break-all;'></div>
						</td>
					</tr>
				</tbody>
			</table>
		</form>
	</div>

</body>
<script type="text/javascript" src="./app/httpclient2.js"></script>
<script type="text/javascript">

</script>

</html>